package com.actionpals.events
{
	import com.actionpals.display.IPopUpable;
	
	import flash.events.Event;

	public class PopUpEvent extends Event
	{
		public static const OPEN:String = "com.actionpals.events.PopUpEvent.OPEN";
		public static const CLOSE:String = "com.actionpals.events.PopUpEvent.CLOSE";
		
		private var _popUp:IPopUpable;
		
		public function PopUpEvent( type:String, bubbles:Boolean=false, cancelable:Boolean=false, popUp:IPopUpable=null )
		{
			super( type, bubbles, cancelable );
			this.popUp = popUp;
		}
		
		public function get popUp():IPopUpable
		{
			return _popUp;
		}
		public function set popUp( value:IPopUpable ):void
		{
			_popUp = value;
		}
		
		public override function clone():Event
		{
			return new PopUpEvent( type, bubbles, cancelable, popUp );
		}
		
		public override function toString():String
		{
			return formatToString( "PopUpEvent", "type", "bubbles", "cancelable", "eventPhase" );
		}
		
	}
}
